home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4898 < prev    next >
Encoding:
Text File  |  1996-08-06  |  2.2 KB  |  56 lines

  1. Path: news2.acs.oakland.edu!news
  2. From: Brad Wilson <bradw@exptech.com>
  3. Newsgroups: comp.os.ms-windows.programmer.win32,comp.lang.basic.visual.misc,comp.os.ms-windows.programmer.ole,comp.lang.c++
  4. Subject: Re: Calling 32-bit DLLs from 16-bit-Applications
  5. Date: Thu, 01 Feb 1996 10:33:15 -0500
  6. Organization: Express Technologies Corp.
  7. Message-ID: <3110DD3B.455D@exptech.com>
  8. References: <4enu1u$20c_001@adv.magwien.gv.at>
  9. NNTP-Posting-Host: ppp-pm01-dy-26.opr.oakland.edu
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b5 (WinNT; I)
  14.  
  15. Wolfgang Steiner wrote:
  16.  
  17. > my problem is following:
  18. > I must use a 32bit-DLL from Visual Basic 3.0 (a 16bit-application)
  19. > under WfW (the DLL also runs with Win32s) and Win95.
  20.  
  21. [snip]
  22.  
  23. > ) Writing a 32bit-OLE-Server? (I could use VC++ 4.0)
  24.  
  25. This is probably your easiest way to get things done.  Write the OLE
  26. server with automation exports, and call the automation calls in the
  27. 16-bit application.  The advantage here is that the OLE libraries will
  28. automatically "marshall" the calls across 16- and 32-bit, regardless
  29. of the operating system in use.
  30.  
  31. Thunking is also an option, but it's specific to the operating system,
  32. so Win32s thunking would _only_ work under WfW.  For what it's worth,
  33. though, the Win32s thunking is extremely easy to do.
  34.  
  35. See the Win32s documentation for information on thunking.
  36.  
  37. >    Is it true, that OLE-container and OLE-server can be written
  38. >    for different APIs (16,32bit)?
  39.  
  40. OLE will automatically marshall across the bit boundary, as long as
  41. both are executables.  In-process servers (DLLs) do not have the benefit
  42. of the automatic marshalling.
  43.  
  44. --
  45. class CBradWilson : public CWorldWatchProgrammingTeam {
  46.   public:
  47.     void GetInetAddr  ( CString& s ) { s = "bradw@exptech.com";      }
  48.     void GetE164Addr  ( CString& s ) { s = "+1 (810) 620-9803";      }
  49.     void GetURL       ( CString& s ) { s = "http://www.exptech.com"; }
  50.     void GetDisclaimer( CString& s ) { s = "All I say is fact :-p";  }
  51. };
  52.  
  53. //  QOTW:  "Don't think of yourself as the least intelligent creature in this
  54. //          room ... if you consider the entire planet, you're smarter than
  55. //          literally hundreds of people."  - Dogbert to Dilbert
  56.